<extend name="Public/publicHTML" />

<block name='content'>
<link href="__COMMON__/daterangepicker/daterangepicker-bs3.css"
	rel="stylesheet" type="text/css" />
<script src="__COMMON__/daterangepicker/moment.min.js"
	type="text/javascript"></script> <script
	src="__COMMON__/daterangepicker/daterangepicker.js"
	type="text/javascript"></script>
<link rel="stylesheet" href="__COMMON__/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet"
	href="__COMMON__/bootstrap/css/font-awesome.min.css" />
	<script src="__COMMON__/js/Ueditor/ueditor.config.js"></script>
	<script src="__COMMON__/js/Ueditor/ueditor.all.min.js"> </script>
	<script src="__COMMON__/js/Ueditor/lang/zh-cn/zh-cn.js"></script>
<div class="wrapper">
<section class="content ">
	<!-- Main content -->
	<div class="container-fluid">
		<div class="pull-right">
			<a href="javascript:history.go(-1)" data-toggle="tooltip" title=""
				class="btn btn-default" data-original-title="返回"><i
				class="fa fa-reply"></i></a> 
		</div>
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">
					<i class="fa fa-list"></i> 添加商品促销活动
				</h3>
			</div>
			<div class="panel-body ">
				<!--表单数据-->
				<form method="post" id="promotion">
					<!--通用信息-->
					<div class="tab-content col-md-10">
						<div class="tab-pane active" id="tab_tongyong">
							<table class="table table-bordered">
								<tbody>
									<tr>
										<td class="col-sm-2">促销活动名称：</td>
										<td class="col-sm-8"><input type="text"
											class="form-control w300" name="{$proGoodsModel::$name_d}" id="name"> 
											<span id="err_attr_name"
											style="color: #F00; display: none;"></span></td>
									</tr>
									<tr>
										<td class="col-sm-2">促销活动类型：</td>
										<td class="col-xs-8"><select id="prom_type" name="{$proGoodsModel::$type_d}" 
											onchange="Promation.partten(this, 'expression', '{:U('getCouponModel')}', '{:U('getDataTypeValue')}')"
											class="form-control w150" >
												<option value="0">---请选择---</option>
												<option value="-1">买就送代金卷</option>
												<if condition="!empty($classData)">
													<foreach name="classData" key='key' item='value'>
														<option status="{$value[$promotionTypeModel::$status_d]}" value="{$key}">{$value[$promotionTypeModel::$promationName_d]}</option>
													</foreach>
												</if>
										</select></td>
									</tr>
									<tr id="expression">
										
									</tr>
									<tr>
										<td>开始时间：</td>
										<td><input type="text" class="form-control w300"
											id="start_time" name="{$proGoodsModel::$startTime_d}" >
										</td>

									</tr>
									<tr>
										<td>结束时间：</td>
										<td><input type="text" class="form-control w300" id="end_time"
											name="{$proGoodsModel::$endTime_d}" ></td>
									</tr>
									<tr>
										<td>适合用户范围：</td>
										<td>
										<if condition="!empty($userLevel)">
											<foreach name="userLevel" key ='key' item="vo"> <input type="checkbox"
												name="{$proGoodsModel::$group_d}[]" value="{$key}"/>{$vo} 
											</foreach>
										</if>
										</td>
									</tr>
									<tr>
										<td>选择商品:</td>
										<td>
											<div class="form-group">
												<div class="col-xs-2">
													<a class="btn btn-primary" href="javascript:void(0);"
														onclick="Promation.selectGoods('{:U('searchGoods')}')"><i class="fa fa-search"></i>添加商品</a>
												</div>
												<div class="col-xs-2">
													<span id="err_goods" style="color: #F00; display: none;">请添加下单商品</span>
												</div>
											</div>
										</td>
									</tr>
									<tr>
										<td colspan="2">
											<div class="form-group">
												<table class="table table-bordered">
													<thead>
														<tr>
															<th style="display: none">选择</th>
															<th class="text-left">商品名称</th>
															<th class="text-left">价格</th>
															<th class="text-left">库存</th>
															<th class="text-left">操作</th>
														</tr>
													</thead>
													<tbody id="goods_list">
														
													</tbody>
												</table>
											</div>
										</td>
									</tr>
									<tr>
										<td class="col-sm-2">活动描述：</td>
										<td class="col-sm-8"><textarea class="span12 ckeditor"
												id="post_content" name="{$proGoodsModel::$description_d}" title="">
							        
							        </textarea></td>
									</tr>
								</tbody>
								<tfoot>
									<tr>
										<td><input class="btn btn-default" type="reset"
											value="重置"></td>
										<td class="text-right"><input class="btn btn-primary"
											type="button" onclick="Promation.addPromation('promotion', '{:U('addProData')}')" value="保存"></td>
									</tr>
								</tfoot>
							</table>
						</div>
					</div>
				</form>
				<!--表单数据-->
			</div>
		</div>
	</div>
</section>
</div>
<script type="text/javascript" src="__COMMON__/js/jquery-form.js"></script> 
 <script type="text/javascript" src="__COMMON__/js/alert.js?a={:time()}"></script> 
<script type="text/javascript" src="__JS__/goods/ueditor.config.js"></script> 
<script type="text/javascript" src="__JS__/promation/promation.js?a={:time()}"></script> 
</block>